<template>
  <div>
    <div class="hot">
      <div class="hot-recommend">
        <ul class="hot-recommend-l">
          <li class="pop">热门推荐</li>
          <li><a href="">华语</a></li>
          <li><a href="">流行</a></li>
          <li><a href="">摇滚</a></li>
          <li><a href="">民谣</a></li>
          <li><a href="">电子</a></li>
        </ul>
        <div class="hot-recommend-r">
          <a href=""> 更多→</a>
        </div>
      </div>

      <div class="hot-s">
        <div class="hot-song" v-for="(item, index) in content" :key="index">
          <li class="hot-song-c">
            <img :src="item.coverImgUrl" alt="" />
            <a href="">{{item.name}}</a>
          </li>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      content: [],
    };
  },
  created() {
    this.pop_music();
  },
  methods: {
    pop_music() {
      this.getAxios("/top/playlist/highquality?limit=20").then((data) => {
        // console.log(data);
        // if(data.code == '200'){

        this.content = data.playlists;
        console.log(this.content);
        // }else{
        //   alert("账");
        // }
      });
    },
  },
  mounted() {
    console.log(this.content);
  },
};
</script>

<style lang="less" scoped>
.hot {
  width: 1200px;
  height: 500px;
  margin: 0 auto;
  & > .hot-recommend {
    width: 1200px;
    background: palegreen;
    overflow: hidden;
    & > .hot-recommend-l {
      float: left;
      & > .pop {
        font-size: large;
        color: #333;
        font-weight: bold;
        padding-left: 40px;
      }
      & > li {
        list-style: none;
        display: inline-block;
        width: 80px;
        height: 50px;
        text-align: center;
        line-height: 50px;
        font-size: small;
        position: relative;
        & > a {
          color: #333;
          text-decoration: none;
        }
        & ::after {
          content: "";
          position: absolute;
          top: 15px;
          left: 3px;
          width: 1px;
          height: 20px;
          background-color: #ccc;
        }
      }
    }
    .hot-recommend-r {
      float: right;
      padding-right: 40px;
      line-height: 50px;
      & > a {
        text-decoration: none;
        color: #666;
      }
    }
  }
  .hot-s {
    margin-top: 40px;
    display: flex;
    width: 100%;
    height: 100%;
    flex-wrap: wrap;
    justify-content:center;
    .hot-song {
      text-align: center;
      width: 250px;
      height: 250px;

      & > li {
        list-style: none;

        & > img {
          width: 200px;
          height: 200px;
          display: block;
        }
        & > a{
          display: block;
          width: 200px;
        }
      }
    }
  }
}
</style>
